package fingerStore;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by mengwei666 on 2016/11/6.
 * 这个类是用来测试" MySQL 查询并打印当前时间的"
 */
public class Test {
    public static void main(String[] args) {
        DBOpener operator = new DBOpener();
        Connection conn = operator.getConn();
        String sql = "SELECT NOW()";
        try {
            PreparedStatement pst = (PreparedStatement) conn.prepareStatement(sql);
            ResultSet res = pst.executeQuery();
            while (res.next())
                System.out.println(res.getString(1));
            pst.close();
            conn.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
